﻿<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:asp="remove">

	<xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes"/>

	<xsl:variable name="img-directory" select='"~/_layouts/images/"' />

	<xsl:template match="/SOAP-ENV:Envelope/SOAP-ENV:Body/Result">
		<table>
			<tr>
				<td>
					<xsl:apply-templates select="Item" />
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="Item">
		<xsl:variable name="id" select="descendant::id" />
		<xsl:variable name="itemNo" select="descendant::item_number" />
		<table>
			<tr>
				<td style="padding-left:10px">
					<img src="{$img-directory}GreenBall.gif" onclick="toggle(this)" />
					<asp:LinkButton runat="server" id="{generate-id()}" commandargument="{$id}" commandname="get" text="{$itemNo}" />
					<div>
						<xsl:attribute name="style">display:block;</xsl:attribute>
						<xsl:apply-templates select="Relationships/Item/related_id" />
						<xsl:apply-templates select="Item" />
					</div>
				</td>
			</tr>
		</table>
		
		
		<!--<script type="text/javascript" language="javascript">
			<xsl:text>var myobj="</xsl:text>
			<xsl:value-of select="$id"/>
				<xsl:text>"</xsl:text>
			validateNodeState(myobj);
		</script>-->
		
		
	</xsl:template>

</xsl:stylesheet>